<?php

include_once "CMS_SQL.php";

class Content{

    protected $id_tree;
    protected $db;

    public function __construct($tree){
        $this->id_tree = $tree;
        $this->db = new CMS_SQL();
    }

    public function set_meta($data){
        return $this->db->CMS_IU(
            'UPDATE vikno_tree
              SET title=:title, keywords=:keywords, description=:description
              WHERE id_tree=:id_tree',
            array(
                ':id_tree' => $this->id_tree,
                ':title' => $data['title'],
                ':keywords' => $data['keywords'],
                ':description' => $data['description'],
            )
        );
    }
    
    public function get_meta(){
        return $this->db->CMS_query(
            'SELECT title, keywords, description FROM vikno_tree WHERE id_tree=:id_tree',
            array(
                ':id_tree' => $this->id_tree
            )
        );
    }
} 